<?php
use common\service\StaticService;
use common\service\GlobalUrlService;
use shopend\assets\ShopAsset;
StaticService::includeAppJsStatic(GlobalUrlService::buildShopStaticUrl('/backend/active/update.js'),ShopAsset::class);
StaticService::includeAppCssStatic(GlobalUrlService::buildShopStaticUrl('/css/active/update.css'),ShopAsset::class);
?>


<div class="layui-card">
  <div class="layui-card-header">活动修改</div>
  <div class="layui-card-body">
    <div class="active_info">
      <h2>信息修改</h2>
      <form class="layui-from">
        <ul>
          <li class="layui-row name">
            <span class="title layui-col-md1 layui-col-sm3">活动名称</span>
            <div class="item layui-col-md11 layui-col-sm9">
              <input type="text" name="" class="layui-input layui-input-inline at_name" value="<?= $activity['active_name'] ?>" />
              <span class="changeNum">0</span>/45
            </div>
          </li>
          <li class="layui-row time">
            <span class="title layui-col-md1 layui-col-sm3">活动时间</span>
            <div class="item layui-col-md11 layui-col-sm9">
              <input type="text" name="" class="layui-input layui-input-inline b-time" id="bg_time" value="<?=date('Y-m-d', $activity['begin_time']) ?>" />
              -
              <input type="text" name="" class="layui-input layui-input-inline e-time" id="ed_time" value="<?=date('Y-m-d', $activity['end_time']) ?>" />
            </div>
          </li>
          <li class="layui-row number">
            <span class="title layui-col-md1 layui-col-sm3">活动人数</span>
            <div class="item layui-col-md11 layui-col-sm9">
              <input type="text" name="" class="layui-input layui-input-inline join_num" value="<?= $activity['active_num'] ?>" />人成团
            </div>
          </li> 
          <input type="hidden" value="<?= $activity['goods_id'] ?>" class="hide_id">
          <input type="hidden" value="<?= $activity['id'] ?>" class="ac_id">
          <input type="hidden" value="<?= $activity_id?>">
          <input type="hidden" value="<?= $goods_id?>" class="goods_id">
        </ul>
      </form>
      <div class="attr_select" style="display: none;">
        <table class="choose-gd layui-table" id="sku_tbody"></table>
        <div class="btns" style="width: 60%; padding: 10px 0;">
          <span class="layui-btn confirm_select_sku">确定选择SKU</span>
          <span class="layui-btn  layui-btn-primary close_select_sku">取消选择SKU</span>
        </div>
      </div>
      
      <div class="attr_modification">
        <h2>SKU修改</h2>
        <table class="layui-table choose-gd" >
          <thead>
            <tr>
              <th class="deep sku" width="180">SKU</th>
              <th class="deep">图片</th>
              <th class="deep">原价</th>
              <th class="deep">拼团价</th>
              <th class="deep">拼团库存</th>
            </tr>
          </thead>
          <tbody id="Th_tbody"><?php foreach ($activity_attr['tbody'] as $key=>$v):?>
          <tr>
            <td><input type="hidden" class="layui-input" value="<?= $v['attr_value'] ?>" /><?= $v['attr_value'] ?></td>
            <td><input type="hidden" value="<?= $v['attr_img'] ?>"><img style="height: 55px;width: 55px;" src="<?= GlobalUrlService::buildCdnUrl($v['attr_img']) ?>"></td>
            <td><input type="text" class="layui-input" value="<?= $v['original_price'] ?>"></td>
            <td><input type="text" class="layui-input" value="<?= $v['collage_price'] ?>"></td>
            <td><input type="text" class="layui-input" value="<?= $v['inventory'] ?>"></td>
            <td style="display: none" ><input type="hidden" value="<?= $v['goods_attre_id'] ?>"/></td>
            <td style="display: none" ><input type="hidden" value="<?= $v['attribute_value_id']?>"></td>
            <td style="display: none" ><input type="hidden" value="<?= $v['id']?>"></td>
          </tr>
        <?php endforeach;?>
      </tbody>
    </table>
    <div class="btns" style="width: 60%; padding: 10px 0;">
      <span class="layui-btn select_sku">重新选择SKU</span>
    </div>
  </div>
  <div class="btns">
    <a href="javascript:" class="layui-btn layui-inline ok">确定</a>
    <a class="layui-btn layui-inline layui-btn-primary" href="<?= GlobalUrlService::buildShopUrl('active/index')?>">返回</a>
  </div>
</div>
</div>

</div>

